//
//  human_detector.hpp
//  yuzon
//
//  Created by Alvin on 2023/3/29.
//

#pragma once

#include <opencv2/opencv.hpp>
#include "paddle_api.h"
#include "common.hpp"

class HumanDetector {
public:
  explicit HumanDetector(const std::string &model_detection_path,
                         const std::string &label_list_path);
  void Predict(const cv::Mat &image, HumanResults &results);
  
private:
  void Preprocess(const cv::Mat &image);
  void Postprocess(const cv::Mat &image, HumanResults &results);
  
  int input_width_;
  int input_height_;
  float threshold_;
  std::shared_ptr<paddle::lite_api::PaddlePredictor> predictor_;
  std::vector<std::string> labels_;
  std::vector<cv::Scalar> colors_;
};
